package main

import "fmt"

func main() {
	//定义一个int数组
	var arr [3]int
	fmt.Println(arr) //[0 0 0]

	//定义一个bool数组
	var arr2 [3]bool
	fmt.Println(arr2) //[false false false]

	//定义数组，完全初始化
	var arr3 [3]int = [3]int{1, 2, 3}
	fmt.Println(arr3) //[1 2 3]

	//简化写法
	var arr33 = [...]int{1, 2, 3}
	fmt.Println(arr33) //[1 2 3]

	//定义数组，部分初始化
	var arr4 [3]int = [3]int{0: 3, 2: 3}
	fmt.Println(arr4) //[3 0 3]

	//修改数组元素
	arr4[1] = 100
}
